package com.furnitur.core.mapper.address;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.furnitur.core.entity.address.Address;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface AddressMapper extends BaseMapper<Address> {
    
    @Update("UPDATE address SET is_default = 0 WHERE user_id = #{userId} AND id != #{addressId}")
    void clearOtherDefault(@Param("userId") Long userId, @Param("addressId") Long addressId);
} 